package ACWing.Dynamicprogramming;
//4725. 末尾字母简单模拟题

import java.util.Scanner;

/**
 * @author :chenjie
 * @date :Created 2022/12/3 19:50
 */
public class EndOFLetter {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String s=sc.nextLine();
        char[] chars = s.toCharArray();
        for (int i = chars.length-2; i >=0; i--) {
            if(chars[i]!=' '){
                if(chars[i]=='A'||chars[i]=='a'||chars[i]=='E'||chars[i]=='e'||chars[i]=='I'||chars[i]=='i'||chars[i]=='o'||chars[i]=='O'||chars[i]=='U'||chars[i]=='u'||chars[i]=='Y'||chars[i]=='y'){
                    System.out.println("YES");
                    break;
                }else {
                    System.out.println("NO");
                    break;
                }
            }
        }

    }
}
